<template>
  <div>首页</div>
</template>

<script>
import btnGroup from './Common/btn-group.vue'
import http from '../assets/js/http'

export default {
  data() {
    return {}
  },
  methods: {
    // 存储缓存信息
    init() {
      _g.closeGlobalLoading()
      this.apiPost('admin/Traindata/School').then((res) => {
        this.handelResponse(res, (data) => {
          // console.log(res)
          let school = {}
          data.forEach(element => {
            school['sch_id_' + element.sch_id] = {
              sch_id: element.sch_id,
              sch_code: element.sch_code,
              sch_name: element.sch_name
            }
          })
          Lockr.set('schInfo', school)// 用户信息
          Lockr.set('schsInfo', res.data)
        })
      })
       // 获取下拉框
      this.apiPost("admin/Report/DropdowmList").then(res => {
        this.handelResponse(res, data => {
          console.log(res)
          Lockr.set('achievements', res.data.achievements)
          Lockr.set('support', res.data.support)
          Lockr.set('type', res.data.type)
        })
      })
    },
  },
  created() {
    this.init()
  },
  computed: {
  },
  components: {
    btnGroup
  },
  mixins: [http]
}
</script>